let mysqlpool = require("../../model/connect");
const getChargeStationbyId=async (request,response)=>{
    let {charge_id} = request.query;
    //取出表单charge_station和charge_station_info信息
    let sql_check = `select a.name,a.type,a.address,a.lng,a.lat,a.pname,a.cityname,a.adname,a.adname,a.tel,a.community,a.distance,b.charge_id,b.charge_station_all,b.charge_station_use,b.charge_price,b.charge_price_cheap,b.charge_station_status
    from charge_station as a,charge_station_info as b
    WHERE a.charge_id = b.charge_id AND a.charge_id = ${charge_id}`
    await mysqlpool.query(sql_check, (err,res)=>{
        response.send({this_chargeStation:res});
     })
    
}
module.exports=getChargeStationbyId